package com.jc.ds.model;

import java.util.Date;

/**
 * xorder_marge
 * @author 
 */
public class XorderMarge extends BaseValueObject {
    private Long id;

    /**
     * 原订单号
     */
    private Long orderId;

    /**
     * 原渠道订单号
     */
    private String channelOrderId;

    /**
     * 新渠道订单号
     */
    private String newChannelOrderId;

    /**
     * 类型 
flush 产生一个与原订单号对应的订单号
marge 合并订单       

     */
    private String type;

    /**
     * 字符串 'false' 可用  'true' 不可用
     */
    private String isDelete;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    private String extend1;

    private String extend2;

    private String extend3;

    private String extend4;

    private String extend5;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getChannelOrderId() {
        return channelOrderId;
    }

    public void setChannelOrderId(String channelOrderId) {
        this.channelOrderId = channelOrderId;
    }

    public String getNewChannelOrderId() {
        return newChannelOrderId;
    }

    public void setNewChannelOrderId(String newChannelOrderId) {
        this.newChannelOrderId = newChannelOrderId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getExtend1() {
        return extend1;
    }

    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    public String getExtend2() {
        return extend2;
    }

    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    public String getExtend3() {
        return extend3;
    }

    public void setExtend3(String extend3) {
        this.extend3 = extend3;
    }

    public String getExtend4() {
        return extend4;
    }

    public void setExtend4(String extend4) {
        this.extend4 = extend4;
    }

    public String getExtend5() {
        return extend5;
    }

    public void setExtend5(String extend5) {
        this.extend5 = extend5;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByOrderId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by order_id asc";
            }else{
                this.orderStr = this.orderStr + ",order_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by order_id desc";
            }else{
                this.orderStr = this.orderStr + ",order_id desc";
            }
        }
    }

    public void orderByChannelOrderId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by channel_order_id asc";
            }else{
                this.orderStr = this.orderStr + ",channel_order_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by channel_order_id desc";
            }else{
                this.orderStr = this.orderStr + ",channel_order_id desc";
            }
        }
    }

    public void orderByNewChannelOrderId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by new_channel_order_id asc";
            }else{
                this.orderStr = this.orderStr + ",new_channel_order_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by new_channel_order_id desc";
            }else{
                this.orderStr = this.orderStr + ",new_channel_order_id desc";
            }
        }
    }

    public void orderByType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by type asc";
            }else{
                this.orderStr = this.orderStr + ",type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by type desc";
            }else{
                this.orderStr = this.orderStr + ",type desc";
            }
        }
    }

    public void orderByIsDelete(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by is_delete asc";
            }else{
                this.orderStr = this.orderStr + ",is_delete asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by is_delete desc";
            }else{
                this.orderStr = this.orderStr + ",is_delete desc";
            }
        }
    }

    public void orderByCreateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by create_time asc";
            }else{
                this.orderStr = this.orderStr + ",create_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by create_time desc";
            }else{
                this.orderStr = this.orderStr + ",create_time desc";
            }
        }
    }

    public void orderByUpdateTime(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by update_time asc";
            }else{
                this.orderStr = this.orderStr + ",update_time asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by update_time desc";
            }else{
                this.orderStr = this.orderStr + ",update_time desc";
            }
        }
    }

    public void orderByExtend1(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend1 asc";
            }else{
                this.orderStr = this.orderStr + ",extend1 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend1 desc";
            }else{
                this.orderStr = this.orderStr + ",extend1 desc";
            }
        }
    }

    public void orderByExtend2(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend2 asc";
            }else{
                this.orderStr = this.orderStr + ",extend2 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend2 desc";
            }else{
                this.orderStr = this.orderStr + ",extend2 desc";
            }
        }
    }

    public void orderByExtend3(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend3 asc";
            }else{
                this.orderStr = this.orderStr + ",extend3 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend3 desc";
            }else{
                this.orderStr = this.orderStr + ",extend3 desc";
            }
        }
    }

    public void orderByExtend4(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend4 asc";
            }else{
                this.orderStr = this.orderStr + ",extend4 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend4 desc";
            }else{
                this.orderStr = this.orderStr + ",extend4 desc";
            }
        }
    }

    public void orderByExtend5(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by extend5 asc";
            }else{
                this.orderStr = this.orderStr + ",extend5 asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by extend5 desc";
            }else{
                this.orderStr = this.orderStr + ",extend5 desc";
            }
        }
    }
}